home *** CD-ROM | disk | FTP | other *** search
- on openP
- global DBfact, TBfact
- set DBfact to xtra("V12Dbe")
- set TBfact to xtra("V12Table")
- end
-
- on createDB
- global DBfact
- set gDb to new(DBfact, the pathName & "reviews.db", "cr", "imagine")
- mCreateTable(gDb, "reviews")
- put mCreateField(gDb, "reviews", "category", "String", 255)
- put mCreateField(gDb, "reviews", "appname", "String", 255)
- put mCreateField(gDb, "reviews", "highs", "String", 2000)
- put mCreateField(gDb, "reviews", "lows", "String", 2000)
- put mCreateField(gDb, "reviews", "Bottomline", "String", 2000)
- put mCreateField(gDb, "reviews", "Rating", "String", 10)
- put mCreateField(gDb, "reviews", "AlphaSortKey", "String", 10)
- put mCreateField(gDb, "reviews", "CoName", "String", 255)
- put mCreateField(gDb, "reviews", "Address", "String", 255)
- put mCreateField(gDb, "reviews", "City", "String", 255)
- put mCreateField(gDb, "reviews", "State", "String", 255)
- put mCreateField(gDb, "reviews", "Zip", "String", 255)
- put mCreateField(gDb, "reviews", "Phone", "String", 255)
- put mCreateField(gDb, "reviews", "Phone2", "String", 255)
- put mCreateField(gDb, "reviews", "email", "String", 255)
- put mCreateField(gDb, "reviews", "m/y/pg", "String", 255)
- put mCreateIndex(gDb, "reviews", "catIdx", "d", "category", "a")
- put mCreateIndex(gDb, "reviews", "nameIdx", "d", "appname", "a")
- put mBuild(gDb)
- set gDb to 0
- end
-
- on openDB
- global DBfact, TBfact, gDb, gTB
- set gDb to new(DBfact, the pathName & "reviews.db", "ReadWrite", "imagine")
- set gTB to new(TBfact, mGetRef(gDb), "reviews")
- end
-
- on Import
- global DBfact, TBfact, gDb, gTB
- put mImportFile(gTB, the pathName & "reviews.txt", TAB, RETURN)
- end
-
- on getOne
- global gTB
- put mGetField(gTB, "name", 1, 2)
- end
-
- on listIt
- global gTB
- put EMPTY into field "theList"
- set n to mSelectCount(gTB)
- repeat with i = 1 to n
- put mGetField(gTB, "category", "category") after field "theList"
- mGoNext(gTB)
- end repeat
- end
-
- on closeP
- global gTB, gDb
- set gTB to 0
- set gDb to 0
- end
-
- on CreateIt
- cursor(4)
- openP()
- createDB()
- openDB()
- Import()
- closeP()
- cursor(1)
- end
-
- on ImportIt
- openDB()
- Import()
- closeP()
- end
-
- on showSelection
- global gTB
- cursor(4)
- set n to mSelectCount(gTB)
- put n into field "totalCount"
- set temp to mGetPosition(gTB)
- mGoFirst(gTB)
- put EMPTY into field "TheList"
- set dummy to EMPTY
- repeat with i = 1 to n
- set nm to mGetField(gTB, "appname")
- put nm & RETURN after dummy
- mGoNext(gTB)
- end repeat
- put dummy into field "TheList"
- mGo(gTB, temp)
- updateDisplay()
- cursor(-1)
- end
-
- on updateDisplay
- global gTB
- set i to mGetPosition(gTB)
- set the foreColor of field "zlist" to 255
- set the foreColor of line i of field "zlist" to 1
- put mGetField(gTB, "category") into field "category"
- put mGetField(gTB, "appname") into field "appname"
- put mGetField(gTB, "highs") into field "highs"
- put mGetField(gTB, "lows") into field "lows"
- put mGetField(gTB, "BottomLine") into field "BottomLine"
- put mGetField(gTB, "Rating") into field "Ratings"
- put mGetField(gTB, "AlphaSortKey") into field "alphsortkey"
- put field "Ratings" & "%" into field "Rating"
- put mGetField(gTB, "CoName") into field "CoName"
- put mGetField(gTB, "Address") into field "Address"
- put mGetField(gTB, "City") into field "City"
- put mGetField(gTB, "State") into field "State"
- put mGetField(gTB, "Zip") into field "Zip"
- put mGetField(gTB, "Phone") into field "Phone"
- put mGetField(gTB, "Phone2") into field "Phone2"
- put mGetField(gTB, "email") into field "email"
- put mGetField(gTB, "m/y/pg") into field "m/y/pg"
- put i into field "totalRecs"
- end
-
- on domSelectCount
- global gTB
- put mSelectCount(gTB) into field "totalCount"
- end
-
- on CheckError errCode, msg
- global gDb
- if errCode <> 0 then
- if objectp(gDb) then
- set errTxt to mError(gDb, errCode)
- else
- set errText to "unknown error"
- end if
- alert("Error" && errCode && "(" & errTxt & ") occured at" && msg)
- end if
- end
-
- on TrackClick
- set spriteNum to the clickOn
- set offCast to the castNum of sprite spriteNum
- set onCast to offCast + 1
- set the castNum of sprite spriteNum to onCast
- updateStage()
- repeat while the mouseDown
- if rollOver(spriteNum) then
- set the castNum of sprite spriteNum to onCast
- else
- set the castNum of sprite spriteNum to offCast
- end if
- updateStage()
- end repeat
- set the castNum of sprite spriteNum to offCast
- updateStage()
- return rollOver(spriteNum)
- end
-
- on getdrive
- set curpath to the moviePath
- set olddelimiter to the itemDelimiter
- set the itemDelimiter to "\"
- set drive to item 1 of curpath & "\"
- set the itemDelimiter to olddelimiter
- return drive
- end
-
- on restartMe
- global DBfact, TBfact
- clearGlobals()
- openXLib(the pathName & "xtras:V12Dbe")
- openXLib(the pathName & "xtras:V12Table")
- set DBfact to xtra("V12Dbe")
- set TBfact to xtra("V12Table")
- set the visible of sprite 47 to 0
- put "All Shareware" into field "fld"
- end
-